﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'GetDistritosByDepaIDAndProviID')
	BEGIN
		PRINT 'DROP  Procedure  GetDistritosByDepaIDAndProviID'
		DROP  Procedure  GetDistritosByDepaIDAndProviID
	END
GO

PRINT 'CREATE Procedure GetDistritosByDepaIDAndProviID'
GO

CREATE Procedure GetDistritosByDepaIDAndProviID

	(
		@intDepartamentoID int
		,@intProvinciaID int
	)

AS

	SELECT IdUbigeo, IdDistrito,Distrito FROM UBIGEO WHERE IdDepartamento = @intDepartamentoID AND IdProvincia = @intProvinciaID

GO


GRANT EXEC ON GetDistritosByDepaIDAndProviID TO PUBLIC

GO


